module.exports = {
  plugins: ["@trivago/prettier-plugin-sort-imports"],
  importOrder: [
    "^react(.*)",
    "^redux(.*)",
    "antd/(.*)",
    "<THIRD_PARTY_MODULES>",
    "^@/types/(.*)$",
    "^@/apis/(.*)$",
    "^@/store/(.*)$",
    "^@/biz-component/(.*)$",
    "^@/components/(.*)$",
    "^@/pages/(.*)$",
    "^@/routes/(.*)$",
    "^@/utils/(.*)$",
    "^@/assets/(.*)$",
    "^@/layout/(.*)$",
    "@/(.*)",
    "^[./]",
  ],
  importOrderSeparation: false,
  importOrderSortSpecifiers: false,
  printWidth: 80,
  useTabs: false,
  tabWidth: 2,
  // trailingComma: "es5",
  semi: true, // 使用分号结尾
  singleQuote: false, // 使用双引号
  // 在对象文字中打印括号之间的空格。
  bracketSpacing: true,
  // 箭头圆括号
  // arrowParens: "avoid",
  // 在文件顶部插入一个特殊的 @format 标记，指定文件格式需要被格式化。
  insertPragma: false,
  // object's key is quoted only when necessary
  quoteProps: "as-needed",
  // use double quotes instead of single quotes in jsx
  jsxSingleQuote: false,
  // no comma at the end
  trailingComma: "all",
  // end tag of jsx need to wrap
  bracketSameLine: false,
  // brackets are required for arrow function parameter, even when there is only one parameter
  arrowParens: "always",
  // format the entire contents of the file
  rangeStart: 0,
  rangeEnd: Infinity,
  // no need to write the beginning @prettier of the file
  requirePragma: false,
  // No need to automatically insert @prettier at the beginning of the file
  // use default break criteria
  proseWrap: "preserve",
  // decide whether to break the html according to the display style
  htmlWhitespaceSensitivity: "css",
  // vue files script and style tags indentation
  vueIndentScriptAndStyle: false,
  // lf for newline
  endOfLine: "lf",
  // formats quoted code embedded
  embeddedLanguageFormatting: "auto",
};
